package com.yanqu.road.server.cmd.activity.shuihuyezicard;

import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.shuihuyezipai.ShuiHuYeZiCardActivityBattleMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @Description
 * @Author cwq
 * @Data 2021/12/7 18:05
 */
@Cmd(code = CrossProtocol.C_CROSS_SHUIHUYEZICARD_CANCEL_MATCH, desc = "水浒叶子牌 取消匹配")
public class CrossShuiHuYeZiCardCancelMatchCmd extends CrossCommand {

    long userId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        userId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        MessageHelper.sendPacket(serverId, userId , YanQuMessageUtils.buildMessage(GameProtocol.S_SHUIHUYEZICARD_CANCEL_MATCH_FROM_CROSS, ShuiHuYeZiCardActivityBattleMgr.cancelMatch(userId)));
    }

    @Override
    public void sendData() {

    }
}
